package com.ruoyi.supplier.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supplier.mapper.TbStoreShelfDetailMapper;
import com.ruoyi.supplier.domain.TbStoreShelfDetail;
import com.ruoyi.supplier.service.ITbStoreShelfDetailService;

/**
 * 库存盘点明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-08
 */
@Service
public class TbStoreShelfDetailServiceImpl implements ITbStoreShelfDetailService 
{
    @Autowired
    private TbStoreShelfDetailMapper tbStoreShelfDetailMapper;

    /**
     * 查询库存盘点明细
     * 
     * @param id 库存盘点明细ID
     * @return 库存盘点明细
     */
    @Override
    public TbStoreShelfDetail selectTbStoreShelfDetailById(Long id)
    {
        return tbStoreShelfDetailMapper.selectTbStoreShelfDetailById(id);
    }

    /**
     * 查询库存盘点明细列表
     * 
     * @param tbStoreShelfDetail 库存盘点明细
     * @return 库存盘点明细
     */
    @Override
    public List<TbStoreShelfDetail> selectTbStoreShelfDetailList(TbStoreShelfDetail tbStoreShelfDetail)
    {
        return tbStoreShelfDetailMapper.selectTbStoreShelfDetailList(tbStoreShelfDetail);
    }

    /**
     * 新增库存盘点明细
     * 
     * @param tbStoreShelfDetail 库存盘点明细
     * @return 结果
     */
    @Override
    public int insertTbStoreShelfDetail(TbStoreShelfDetail tbStoreShelfDetail)
    {
        tbStoreShelfDetail.setCreateTime(DateUtils.getNowDate());
        tbStoreShelfDetail.setCreateBy(SecurityUtils.getUsername());
        return tbStoreShelfDetailMapper.insertTbStoreShelfDetail(tbStoreShelfDetail);
    }

    /**
     * 修改库存盘点明细
     * 
     * @param tbStoreShelfDetail 库存盘点明细
     * @return 结果
     */
    @Override
    public int updateTbStoreShelfDetail(TbStoreShelfDetail tbStoreShelfDetail)
    {
        tbStoreShelfDetail.setUpdateTime(DateUtils.getNowDate());
        tbStoreShelfDetail.setUpdateBy(SecurityUtils.getUsername());
        return tbStoreShelfDetailMapper.updateTbStoreShelfDetail(tbStoreShelfDetail);
    }

    /**
     * 批量删除库存盘点明细
     * 
     * @param ids 需要删除的库存盘点明细ID
     * @return 结果
     */
    @Override
    public int deleteTbStoreShelfDetailByIds(Long[] ids)
    {
        return tbStoreShelfDetailMapper.deleteTbStoreShelfDetailByIds(ids);
    }

    /**
     * 删除库存盘点明细信息
     * 
     * @param id 库存盘点明细ID
     * @return 结果
     */
    @Override
    public int deleteTbStoreShelfDetailById(Long id)
    {
        return tbStoreShelfDetailMapper.deleteTbStoreShelfDetailById(id);
    }
}
